
CMD = gcc -ggdb -fPIC -I/usr/local/include/ -I. -Iwrap -shared -lgsl -lgslcblas
CMD = gcc -ggdb -fPIC -I/opt/local/include/ -I. -Iwrap -dynamiclib -L/opt/local/lib -lgsl -lgslcblas -L.

GSL_INC=/usr/include/gsl
GSL_INC=/opt/local/include/gsl

SRC_TYPES = wrap/dao_gsl_types.c wrap/dao_gsl_types2.c wrap/dao_gsl_types3.c

SRC_BLAS = wrap/dao_gsl_blas.c wrap/dao_gsl_blas2.c wrap/dao_gsl_blas3.c

SRC_BLOCK = wrap/dao_gsl_block.c wrap/dao_gsl_block2.c wrap/dao_gsl_block3.c

SRC_VECTOR = wrap/dao_gsl_vector.c wrap/dao_gsl_vector2.c wrap/dao_gsl_vector3.c 

SRC_MATRIX = wrap/dao_gsl_matrix.c wrap/dao_gsl_matrix2.c wrap/dao_gsl_matrix3.c 

SRC_PERMUTE = wrap/dao_gsl_permutation.c wrap/dao_gsl_permutation2.c wrap/dao_gsl_permutation3.c 

SRC_SF = wrap/dao_gsl_special_functions.c wrap/dao_gsl_special_functions2.c wrap/dao_gsl_special_functions3.c 

SRC_SORT = wrap/dao_gsl_sorting.c wrap/dao_gsl_sorting2.c wrap/dao_gsl_sorting3.c 

SRC_FFT = wrap/dao_gsl_fft.c wrap/dao_gsl_fft2.c wrap/dao_gsl_fft3.c 

SRC_STAT = wrap/dao_gsl_statistics.c wrap/dao_gsl_statistics2.c wrap/dao_gsl_statistics3.c 

SRC_OTHERS = wrap/dao_gsl_others.c wrap/dao_gsl_others2.c wrap/dao_gsl_others3.c

DEF_BASIC = gsl_types.h,gsl_mode.h,gsl_version.h,gsl_errno.h,gsl_const_cgs.h,gsl_const_cgsm.h,gsl_const.h,gsl_const_mksa.h,gsl_const_mks.h,gsl_const_num.h,gsl_machine.h,gsl_ieee_utils.h,gsl_nan.h,gsl_precision.h

DEF_BLAS = gsl_blas.h,gsl_cblas.h,gsl_blas_types.h

DEF_BLOCK = gsl_block.h,gsl_block_char.h,gsl_block_double.h,gsl_block_float.h,gsl_block_int.h,gsl_block_long.h,gsl_block_long_double.h,gsl_block_short.h,gsl_block_uchar.h,gsl_block_uint.h,gsl_block_ulong.h,gsl_block_ushort.h,gsl_block_complex_double.h,gsl_block_complex_float.h,gsl_block_complex_long_double.h

DEF_VECTOR = gsl_vector.h,gsl_vector_char.h,gsl_vector_double.h,gsl_vector_float.h,gsl_vector_int.h,gsl_vector_long.h,gsl_vector_long_double.h,gsl_vector_short.h,gsl_vector_uchar.h,gsl_vector_uint.h,gsl_vector_ulong.h,gsl_vector_ushort.h,gsl_vector_complex.h,gsl_vector_complex_double.h,gsl_vector_complex_float.h,gsl_vector_complex_long_double.h

DEF_MATRIX = gsl_matrix.h,gsl_matrix_char.h,gsl_matrix_double.h,gsl_matrix_float.h,gsl_matrix_int.h,gsl_matrix_long_double.h,gsl_matrix_long.h,gsl_matrix_short.h,gsl_matrix_uchar.h,gsl_matrix_uint.h,gsl_matrix_ulong.h,gsl_matrix_ushort.h,gsl_matrix_complex_double.h,gsl_matrix_complex_float.h,gsl_matrix_complex_long_double.h

DEF_TYPES = $(DEF_BASIC),gsl_complex.h,$(DEF_BLOCK),$(DEF_VECTOR),$(DEF_MATRIX)

DEF_PERMUTE2 = gsl_permute.h,gsl_permutation.h,gsl_permute_char.h,gsl_permute_double.h,gsl_permute_float.h,gsl_permute_int.h,gsl_permute_long.h,gsl_permute_long_double.h,gsl_permute_short.h,gsl_permute_uchar.h,gsl_permute_uint.h,gsl_permute_ulong.h,gsl_permute_ushort.h,gsl_permute_vector_char.h,gsl_permute_vector.h,gsl_permute_vector_double.h,gsl_permute_vector_float.h,gsl_permute_vector_int.h,gsl_permute_vector_long.h,gsl_permute_vector_long_double.h,gsl_permute_vector_short.h,gsl_permute_vector_uchar.h,gsl_permute_vector_uint.h,gsl_permute_vector_ulong.h,gsl_permute_vector_ushort.h,gsl_permute_complex_double.h,gsl_permute_complex_float.h,gsl_permute_complex_long_double.h,gsl_permute_vector_complex_double.h,gsl_permute_vector_complex_float.h,gsl_permute_vector_complex_long_double.h

DEF_PERMUTE = $(DEF_TYPES):$(DEF_PERMUTE2)

DEF_SF = gsl_sf.h,gsl_sf_airy.h,gsl_sf_bessel.h,gsl_sf_clausen.h,gsl_sf_coulomb.h,gsl_sf_coupling.h,gsl_sf_dawson.h,gsl_sf_debye.h,gsl_sf_dilog.h,gsl_sf_elementary.h,gsl_sf_ellint.h,gsl_sf_elljac.h,gsl_sf_erf.h,gsl_sf_exp.h,gsl_sf_expint.h,gsl_sf_fermi_dirac.h,gsl_sf_gamma.h,gsl_sf_gegenbauer.h,gsl_sf_hyperg.h,gsl_sf_laguerre.h,gsl_sf_lambert.h,gsl_sf_legendre.h,gsl_sf_log.h,gsl_sf_pow_int.h,gsl_sf_psi.h,gsl_sf_result.h,gsl_sf_synchrotron.h,gsl_sf_transport.h,gsl_sf_trig.h,gsl_sf_zeta.h

DEF_SORT = $(DEF_TYPES):gsl_sort.h,gsl_sort_char.h,gsl_sort_double.h,gsl_sort_float.h,gsl_sort_int.h,gsl_sort_long.h,gsl_sort_long_double.h,gsl_sort_short.h,gsl_sort_uchar.h,gsl_sort_uint.h,gsl_sort_ulong.h,gsl_sort_ushort.h,gsl_sort_vector_char.h,gsl_sort_vector.h,gsl_sort_vector_double.h,gsl_sort_vector_float.h,gsl_sort_vector_int.h,gsl_sort_vector_long.h,gsl_sort_vector_long_double.h,gsl_sort_vector_short.h,gsl_sort_vector_uchar.h,gsl_sort_vector_uint.h,gsl_sort_vector_ulong.h,gsl_sort_vector_ushort.h,gsl_heapsort.h

DEF_FFT = $(DEF_TYPES):gsl_fft.h,gsl_fft_real.h,gsl_fft_real_float.h,gsl_fft_halfcomplex.h,gsl_fft_halfcomplex_float.h,gsl_fft_complex.h,gsl_fft_complex_float.h,gsl_dft_complex.h,gsl_dft_complex_float.h

DEF_STAT = $(DEF_TYPES):gsl_statistics.h,gsl_statistics_char.h,gsl_statistics_double.h,gsl_statistics_float.h,gsl_statistics_int.h,gsl_statistics_long.h,gsl_statistics_long_double.h,gsl_statistics_short.h,gsl_statistics_uchar.h,gsl_statistics_uint.h,gsl_statistics_ulong.h,gsl_statistics_ushort.h

DEF_OTHERS = $(DEF_TYPES),$(DEF_PERMUTE2):gsl_cdf.h,gsl_chebyshev.h,gsl_deriv.h,gsl_dht.h,gsl_diff.h,gsl_eigen.h,gsl_fit.h,gsl_histogram2d.h,gsl_histogram.h,gsl_integration.h,gsl_interp.h,gsl_linalg.h,gsl_math.h,gsl_min.h,gsl_monte.h,gsl_monte_miser.h,gsl_monte_plain.h,gsl_monte_vegas.h,gsl_multifit.h,gsl_multifit_nlin.h,gsl_multimin.h,gsl_multiroots.h,gsl_ntuple.h,gsl_randist.h,gsl_rng.h,gsl_roots.h,gsl_siman.h,gsl_specfunc.h,gsl_spline.h,gsl_sum.h,gsl_sys.h,gsl_wavelet2d.h,gsl_wavelet.h,gsl_odeiv.h


all: 
	$(CMD) -install_name libdao_gsl_types.dylib -o libdao_gsl_types.dylib $(SRC_TYPES)
	$(CMD) -install_name libdao_gsl_special_functions.dylib -o libdao_gsl_special_functions.dylib $(SRC_SF) -ldao_gsl_types
	$(CMD) -install_name libdao_gsl_permutation.dylib -o libdao_gsl_permutation.dylib $(SRC_PERMUTE) -ldao_gsl_types
	$(CMD) -install_name libdao_gsl_sorting.dylib -o libdao_gsl_sorting.dylib $(SRC_SORT) -ldao_gsl_types
	$(CMD) -install_name libdao_gsl_statistics.dylib -o libdao_gsl_statistics.dylib $(SRC_STAT) -ldao_gsl_types
	$(CMD) -install_name libdao_gsl_others.dylib -o libdao_gsl_others.dylib $(SRC_OTHERS) -ldao_gsl_types -ldao_gsl_permutation
	$(CMD) -install_name libdao_gsl_fft.dylib -o libdao_gsl_fft.dylib $(SRC_SORT) -ldao_gsl_types

bind:
	@test -d wrap || mkdir wrap
	autobind.dao $(DEF_FFT) wrap_name=gsl_fft include=gsl_types dir_input=$(GSL_INC) dir_output=wrap dir_inc=gsl fixing=fixing.txt
	autobind.dao $(DEF_TYPES) wrap_name=gsl_types dir_input=$(GSL_INC) dir_output=wrap dir_inc=gsl fixing=fixing.txt
	autobind.dao $(DEF_SF) wrap_name=gsl_special_functions include=gsl_types dir_input=$(GSL_INC) dir_output=wrap dir_inc=gsl fixing=fixing.txt
	autobind.dao $(DEF_PERMUTE) wrap_name=gsl_permutation include=gsl_types dir_input=$(GSL_INC) dir_output=wrap dir_inc=gsl fixing=fixing.txt
	autobind.dao $(DEF_SORT) wrap_name=gsl_sorting include=gsl_types dir_input=$(GSL_INC) dir_output=wrap dir_inc=gsl fixing=fixing.txt
	autobind.dao $(DEF_STAT) wrap_name=gsl_statistics include=gsl_types dir_input=$(GSL_INC) dir_output=wrap dir_inc=gsl fixing=fixing.txt
	autobind.dao $(DEF_OTHERS) wrap_name=gsl_others include=gsl_types,gsl_permutation dir_input=$(GSL_INC) dir_output=wrap dir_inc=gsl fixing=fixing.txt

